{% extends "counterpoint/forum_base.html" %}

{% block title %}{{ thread.title_escaped }} - {{ block.super }}{% endblock %}

{% block breadcrumbs %}{{ block.super }} &raquo; <a href="{{ forum.get_absolute_url }}">{{ forum }}</a> &raquo; {{ thread }}{% endblock %}
{% block breadcrumbs2 %}{{ block.super }} &raquo; <a href="{{ forum.get_absolute_url }}">{{ forum }}</a> &raquo; {{ thread }}{% endblock %}

{% block nexturl %}{{ thread.get_absolute_url }}{% endblock %}

{% block buttons %}
            <td>
              <a title="Post a new topic" class="button" href="{{ forum.new_topic_url }}">New Topic</a>
              {% if thread.locked %}{% if perms.forum.change_post %}<a title="Thread closed, no replies allowed" class="button" href="{{ thread.reply_url }}">Closed</a>{% else %}<span title="Thread closed, no replies allowed" class="button disabled">Closed</span>{% endif %}{% else %}<a title="Post a reply" class="button" href="{{ thread.reply_url }}">Reply</a>{% endif %}
              {# {% if subbed %}<a title="Unsubscribe from this thread" class="button" href="{{ thread.unsub_url }}">Unsubscribe</a>{% else %}<a title="Subscribe to this thread" class="button" href="{{ thread.sub_url }}">Subscribe</a>{% endif %} #}
            </td>
{% endblock %}
{% block buttons2 %}
            <td>
              <!--
              <a title="Post a new topic" class="button" href="{{ forum.new_topic_url }}">New Topic</a>
              {% if thread.locked %}{% if perms.forum.change_post %}<a title="Thread closed, no replies allowed" class="button" href="{{ thread.reply_url }}">Closed</a>{% else %}<span title="Thread closed, no replies allowed" class="button disabled">Closed</span>{% endif %}{% else %}<a title="Post a reply" class="button" href="{{ thread.reply_url }}">Reply</a>{% endif %}
              {# {% if subbed %}<a title="Unsubscribe from this thread" class="button" href="{{ thread.unsub_url }}">Unsubscribe</a>{% else %}<a title="Subscribe to this thread" class="button" href="{{ thread.sub_url }}">Subscribe</a>{% endif %} #}
              -->
            </td>
{% endblock %}

{% block content %}
        <table>
  {% for post in object_list %}
          <tr class="{% cycle row1,row2 as rowcolors %}">
            <td class="user_info">
              <span class="user_name"><a href="{{ post.author.get_absolute_url }}" class="{{ post.author.get_access_display }}">{{ post.author }}</a></span><br />
              {% spaceless %}
                {% if post.author.avatar %}
                  <img src="{{ post.author.avatar }}" class="avatar" alt="Avatar" /><br />
                {% endif %}
              {% endspaceless %}
              <span class="user_access">{{ post.author.get_access_display }}<br /><br />
              <!-- Location: -->{{ post.author.location }}<br />
              Posts: {{ post.author.post_count }}<br />
              {% if perms.forum.change_post %}<br />IP: {{ post.author_ip }}{% endif %}
              <br /></span>
            </td>
            <td class="post_body" id="p{{ post.id }}">
              <div class="post_date">
                {% spaceless %}
                  <a href="{{ post.parent_post.get_absolute_url }}#p{{ post.id }}"><img class="post_img" title="Link to this post" alt="" src="{{ MEDIA_URL }}images/post.gif" /></a>
                  <span class="post_time">Posted {{ post.posted|date:"F j, Y \a\t H:i" }}</span>
                  {% if perms.forum.change_post %}
                    <span class="edit_text">[<a title="Edit this post" href="{{ post.edit_url }}">Edit</a>]</span>
                  {% else %}
                    {% ifequal post.author forum_user %}
                      <span class="edit_text">[<a title="Edit this post" href="{{ post.edit_url }}">Edit</a>]</span>
                    {% endifequal %}
                  {% endif %}
              {% endspaceless %}
              </div>
              <div class="{{ post.author.get_access_display }}">{{ post.body_escaped|safe }}</div>
              {% spaceless %}
                {% if post.edited %}
                  <br /><br /><div class="post_edited">Edited by {{ post.edited_by }} on {{ post.edit_time|date:"F j, Y \a\t H:i" }}</div>
                {% endif %}
              {% endspaceless %}
            </td>
          </tr>
  {% endfor %}
        </table>
{% endblock %}
